Skip to content

Conversation

turchinc
Copy link

The issue is that the downloadSass task wasn't properly configured for Gradle's incremental builds and caching. Even though overwrite(false) was set, the task was still running the download every time because:

  1. The task didn't have an explicit condition to skip execution when the output file already exists.
  2. Caching was disabled for the task, leading to "No history is available" and preventing Gradle from reusing previous results.

I've updated the SassGradlePlugin.java to:

  • Add task.onlyIf(task -> !task.getDest().exists()) to the downloadSass task, ensuring it only runs if the archive file doesn't exist.
  • Enable caching with task.getOutputs().cacheIf(task -> true) for both downloadSass and installSass tasks, allowing Gradle to cache and reuse the outputs.

This should prevent unnecessary downloads on subsequent builds, as the tasks will now be up-to-date when the files exist and can leverage build caching.

Test it by running your build again—the download should be skipped if the Sass archive is already present.

@turchinc
Copy link
Author

see also #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant